<?php
/**
 * Created by PhpStorm.
 * User: tom_xia
 * Date: 2018/3/15
 * Time: 15:40
 * 登录过滤
 */
require_once dirname(__DIR__) . "/common.php";
use app\cls\tom\Response;

if(empty($_SERVER["HTTP_AUTH_TOKEN"]) ){
    Response::output(-1001,"user no login!1");
}
$token = $_SERVER["HTTP_AUTH_TOKEN"];

$userService = new \app\service\User();
$u_info = $userService->validateToken($token,true);
if($u_info instanceof Response){
    Response::outputSelf($u_info);
}
/*==================================================================
 * 用户信息 user_id  user_uuid nickname head_image 等等
 *=================================================================*/
$Auth = &$u_info;